@extends('backend::layout')
@section('title',$page_title)
@section('content')
    @if(isset($search))
        {{$search->render()}}
    @endif
    @component('backend::component.table.table-content')
        @slot('page_title') {{$page_title}} @endslot
        @slot('body_content')
            @if($list->isNotEmpty())
                <div class="table-responsive">
                    <table class="list table table-bordered table-striped">
                        <thead>
                        <tr>
                            <th>
                                @component('backend::component.checkbox')
                                    @slot('name') ids-all @endslot
                                @endcomponent
                            </th>
                            <th>时间</th>
                            <th>会员账号</th>
                            <th>相关账号</th>
                            <th>金额</th>
                        </tr>
                        </thead>
                        <tbody>
                        @foreach($list as $item)
                            <tr>
                                <td class="text-truncate">
                                    @component('backend::component.checkbox')
                                        @slot('name') id[] @endslot
                                        @slot('class') id @endslot
                                        @slot('value') {{$item->id}} @endslot
                                    @endcomponent
                                </td>
                                <td style="max-width: 100px;">{{$item->created_at}}</td>
                                <td class="text-truncate text-more-hide">
                                    账户：{{$item->target->user_number}}<br/>
                                    姓名：{{$item->target->real_name}}<br/>
                                    电话：{{$item->target->user_phone}}
                                </td>
                                <td class="text-truncate text-more-hide">
                                    账户：{{$item->relate->user_number ?? '公司'}}<br/>
                                    姓名：{{$item->relate->real_name ?? '公司'}}<br/>
                                    电话：{{$item->relate->user_phone ?? '公司'}}
                                </td>
                                <td>
                                    金额:@if($item->inout == 1)<span style="color: red;">+{{$item->money}}</span>
                                    @else
                                        -{{$item->money}}
                                    @endif[{{get_currency('id')[$item->money_type]?? '未知'}}]<br/>
                                    余额:{{$item->after_money}}<br/>
                                    类型:{{get_change()[$item->change_type] ?? '未知'}}
                                </td>
                            </tr>
                        @endforeach
                        </tbody>
                    </table>
                    @slot('list_page')
                        {{$list->appends($search->getSearchData())->links('backend::public.pagination')}}
                    @endslot
                </div>
            @else
                @include('backend::public.empty_page',['info'=>'暂时没有财务流水'])
            @endif
        @endslot
    @endcomponent
@endsection